﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Admin.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<CognisessWeb.Models.BlogsModel>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Blog
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Blog</h2>

    <table>
        <tr>
           
            <th>
                Id
            </th>
            <th>
                Title
            </th>
            <th>
                BloggerName
            </th>
            <th>
                BlogContent
            </th> 
            <th>
                CreateTime
            </th> 
            <th>
                
            </th>             
        </tr>

    <% foreach (var item in Model) { %>
    
        <tr>
            
            <td>
                <%= Html.Encode(item.Id) %>
            </td>
            <td>
                <%= Html.Encode(item.Title) %>
            </td>
            <td>
                <%= Html.Encode(item.BloggerName) %>
            </td>
            <td>
                <%= Html.Encode(item.BlogContent) %>
            </td>
            <td>
                <%= Html.Encode(item.CreateTime) %>
            </td>
            <td align="center">
                <a href="/Blog/Edit/<%=item.Id %>">
                    <img src='../../Content/images/backstage_img5.gif' alt="Edit" /></a> <a href="/Blog/Details/<%=item.Id %>">
                        <img src='../../Content/images/backstage_img7.gif' alt="Details" /></a>
                <a href="/Blog/Delete/<%=item.Id %>">
                    <img src='../../Content/images/backstage_img4.gif' alt="Delete" onclick="return confirm('Are you sure to delete this record?');" /></a>
            </td>
        </tr>
    
    <% } %>

    </table>

    <p>
        <%= Html.ActionLink("Create New", "Create") %>
    </p>

</asp:Content>

